<template>
  <router-view :key="routekey"></router-view>
</template>

<script>
export default {
  computed: {
    routekey() {
      const { key = "" } = this.$route.meta;
      if (!key) return this.$route.fullPath;
      if (key === "name") return this.$route.name;
      if (key.includes(",")) {
        const { query } = this.$route;
        const keys = key.split(",");
        return keys.map((k) => `${k}-${query[k] || ""}`).join("");
      }
      return key;
    },
  },
};
</script>
